package com.vms;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;

public class Settings implements  SharedPreferences.OnSharedPreferenceChangeListener {

	public enum ValueType {
		WEIGHT_MORNING("weight_morning_type",101),
		WEIGHT_EVENING("weight_evening_type",102),
		WAIST("waist_type",201),
		CHEST("chest_type",301),
		THIGH("thigh_type",402);
		
		public final String mName;
		public final int mId;

		ValueType(String name, int id) {
			this.mName = name;
			this.mId = id;
		}
		
		public static ValueType fromString ( String name ) {
			for (ValueType v : ValueType.values()) {
				if(v.mName.equals(name))
					return v;
			}
			return null;
		}
	}

	public Settings(Context context) {
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
		preferences.registerOnSharedPreferenceChangeListener(this);
	}
	
	
	@Override
	public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
		Log.d(NetLog.TAG, "onSharedPreferenceChanged key:"+key);
	}
	
	
}
